/*
 * GeneroDAOImpl.java
 * 
 * Versao: 1.0.0
 *
 * Data: 23/04/2011
 *
 * Copyright (C) 2011
 * wsh-systems.
 * Todos os direitos reservados.
 */
package com.wsh.playeronline.persistence.daoImpl;

import java.util.List;

import javax.persistence.EntityManager;

import com.wsh.playeronline.persistence.dao.GeneroDAO;
import com.wsh.playeronline.persistence.model.Genero;

/**
 * Implementacao do GeneroDAO.
 * 
 * @author Washington
 * @version 1.0, 23/04/2011
 */
public class GeneroDAOImpl implements GeneroDAO {

	private final DAOImpl<Genero> dao;
	
	/**
	 * Constructor get to EntityManager.
	 * 
	 * @param em EntityManager
	 */
	public GeneroDAOImpl(final EntityManager em) {
		this.dao = new DAOImpl<Genero>(em, Genero.class);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public void adicionar(Genero t) {
		this.dao.adiciona(t);
	}

	/**
	 * {@inheritDoc}
	 */
	public void alterar(Genero t) {
		this.dao.altera(t);
	}

	/**
	 * {@inheritDoc}
	 */
	public Genero buscar(Long codigo) {
		return this.dao.busca(codigo);
	}

	/**
	 * {@inheritDoc}
	 */
	public void deletar(Genero t) {
		this.dao.deleta(t);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Genero> listar() {
		return this.dao.lista();
	}

	/**
	 * {@inheritDoc}
	 */
	public void remover(Genero t) {
		this.dao.remove(t);
	}	
	
}